package com.simple.gateway.common.authorization;

import org.apache.shiro.authc.AuthenticationToken;

/**
 * 项目: simple-gateway
 * <p>
 * 功能描述: 网关授权token
 *
 * @author: WuChengXing
 * @create: 2023-08-05 23:14
 **/
public class GatewayAuthorizingToken implements AuthenticationToken {

    private static final long serialVersionUID = 1L;

    /**
     * 通信管道ID
     */
    private String uId;

    /**
     * JSON WEB TOKEN
     */
    private String jwt;

    public GatewayAuthorizingToken() {
    }

    public GatewayAuthorizingToken(String uId, String jwt) {
        this.uId = uId;
        this.jwt = jwt;
    }

    @Override
    public Object getPrincipal() {
        return uId;
    }

    @Override
    public Object getCredentials() {
        return this.jwt;
    }

    public String getJwt() {
        return jwt;
    }

    public void setJwt(String jwt) {
        this.jwt = jwt;
    }
}
